
package jp.moisture.othello.board;

public class Cell {

    public static final Cell GIVE_UP = new Cell(-1, -1);
    int mX;
    int mY;
    Stone mStone;

    public Cell(int x, int y) {
        mX = x;
        mY = y;
    }

    public Cell(Cell cell) {
        mX = cell.mX;
        mY = cell.mY;
        if (cell.mStone != null) {
            mStone = new Stone(cell.mStone);
        }
    }

    public final void setStone(int color) {
        mStone = new Stone(color);
    }

    public final int getX() {
        return mX;
    }

    public final int getY() {
        return mY;
    }

    public Stone getStone() {
        return mStone;
    }

    public boolean existsStone() {
        return mStone != null;
    }

    @Override
    public String toString() {
        if (mStone == null) {
            //            return "□";
            return "　";
        }
        return mStone.toString();
    }

    public String toStringData() {
        return "(" + (mX + 1) + "," + (mY + 1) + ")" + toString();
    }

}
